<?php
class M_list_pengaduan extends arfaModel{
	
	function __construct() 
	{
        parent::__construct();
		$this->table_name	= "list_pengaduan";
		$this->primary_key	= "KD_LIST_PENGADUAN";
		$this->order_by		= "KD_LIST_PENGADUAN ASC";
    }
	
	function get_data(){
		$query = $this->db->query("
		SELECT
		list_pengaduan.KD_LIST_PENGADUAN,
		list_pengaduan.NAMA,
		list_pengaduan.NO_TELEPON,
		list_pengaduan.EMAIL,
		list_pengaduan.ISI,
		list_pengaduan.MEDIA,
		list_pengaduan.KD_IJIN,
		list_pengaduan.NO_UPTSA,
		list_pengaduan.TANGGAL,
		list_pengaduan.STATUS,
		list_pengaduan.KATEGORI_P,
		master_ijin.ID_IJIN,
		master_ijin.NAMA_IJIN
		FROM list_pengaduan
		LEFT JOIN master_ijin master_ijin ON list_pengaduan.KD_IJIN = master_ijin.ID_IJIN
		ORDER BY list_pengaduan.KD_LIST_PENGADUAN DESC
		");
		
		return $query->result_array();
	}
	
	function select_data($id)
	{
		$this->db->select('*');
		$this->db->from($this->table_name);
		$this->db->where('KD_LIST_PENGADUAN',$id);
		$query = $this->db->get();
		
		return $query->result_array();
	}
	
	function get_tanggal($get_taw,$get_tak)
	{
		$query = $this->db->query("
			SELECT 
			list_pengaduan.KD_LIST_PENGADUAN,
			list_pengaduan.NAMA,
			list_pengaduan.NO_TELEPON,
			list_pengaduan.EMAIL,
			list_pengaduan.ISI,
			list_pengaduan.MEDIA,
			list_pengaduan.KD_IJIN,
			list_pengaduan.NO_UPTSA,
			list_pengaduan.TANGGAL,
			list_pengaduan.STATUS,
			list_pengaduan.KATEGORI_P,
			master_ijin.ID_IJIN,
			master_ijin.NAMA_IJIN
			FROM list_pengaduan
			LEFT JOIN master_ijin master_ijin ON list_pengaduan.KD_IJIN = master_ijin.ID_IJIN
		");
		
		return $query->result_array();
	}
	
	function get_skrk($get_taw,$get_tak)
	{
		$query = $this->db->query("
			SELECT 
			list_pengaduan.KD_LIST_PENGADUAN,
			list_pengaduan.NAMA,
			list_pengaduan.NO_TELEPON,
			list_pengaduan.EMAIL,
			list_pengaduan.ISI,
			list_pengaduan.MEDIA,
			list_pengaduan.KD_IJIN,
			list_pengaduan.NO_UPTSA,
			list_pengaduan.TANGGAL,
			list_pengaduan.STATUS,
			list_pengaduan.KATEGORI_P,
			master_ijin.ID_IJIN,
			master_ijin.NAMA_IJIN
			FROM list_pengaduan
			LEFT JOIN master_ijin master_ijin ON list_pengaduan.KD_IJIN = master_ijin.ID_IJIN
			WHERE list_pengaduan.KD_IJIN = 1
		");
		
		return $query->result_array();
	}
	
	function get_imb($get_taw,$get_tak)
	{
		$query = $this->db->query("
			SELECT 
			list_pengaduan.KD_LIST_PENGADUAN,
			list_pengaduan.NAMA,
			list_pengaduan.NO_TELEPON,
			list_pengaduan.EMAIL,
			list_pengaduan.ISI,
			list_pengaduan.MEDIA,
			list_pengaduan.KD_IJIN,
			list_pengaduan.NO_UPTSA,
			list_pengaduan.TANGGAL,
			list_pengaduan.STATUS,
			list_pengaduan.KATEGORI_P,
			master_ijin.ID_IJIN,
			master_ijin.NAMA_IJIN
			FROM list_pengaduan
			LEFT JOIN master_ijin master_ijin ON list_pengaduan.KD_IJIN = master_ijin.ID_IJIN
			WHERE list_pengaduan.KD_IJIN = 2
		");
		
		return $query->result_array();
	}
	
	function get_ho($get_taw,$get_tak)
	{
		$query = $this->db->query("
			SELECT 
			list_pengaduan.KD_LIST_PENGADUAN,
			list_pengaduan.NAMA,
			list_pengaduan.NO_TELEPON,
			list_pengaduan.EMAIL,
			list_pengaduan.ISI,
			list_pengaduan.MEDIA,
			list_pengaduan.KD_IJIN,
			list_pengaduan.NO_UPTSA,
			list_pengaduan.TANGGAL,
			list_pengaduan.STATUS,
			list_pengaduan.KATEGORI_P,
			master_ijin.ID_IJIN,
			master_ijin.NAMA_IJIN
			FROM list_pengaduan
			LEFT JOIN master_ijin master_ijin ON list_pengaduan.KD_IJIN = master_ijin.ID_IJIN
			WHERE list_pengaduan.KD_IJIN = 3
		");
		
		return $query->result_array();
	}
	
	function get_tdup($get_taw,$get_tak)
	{
		$query = $this->db->query("
			SELECT 
			list_pengaduan.KD_LIST_PENGADUAN,
			list_pengaduan.NAMA,
			list_pengaduan.NO_TELEPON,
			list_pengaduan.EMAIL,
			list_pengaduan.ISI,
			list_pengaduan.MEDIA,
			list_pengaduan.KD_IJIN,
			list_pengaduan.NO_UPTSA,
			list_pengaduan.TANGGAL,
			list_pengaduan.STATUS,
			list_pengaduan.KATEGORI_P,
			master_ijin.ID_IJIN,
			master_ijin.NAMA_IJIN
			FROM list_pengaduan
			LEFT JOIN master_ijin master_ijin ON list_pengaduan.KD_IJIN = master_ijin.ID_IJIN
			WHERE list_pengaduan.KD_IJIN = 4
		");
		
		return $query->result_array();
	}
	
	function get_ssw($get_taw,$get_tak)
	{
		$query = $this->db->query("
			SELECT 
			list_pengaduan.KD_LIST_PENGADUAN,
			list_pengaduan.NAMA,
			list_pengaduan.NO_TELEPON,
			list_pengaduan.EMAIL,
			list_pengaduan.ISI,
			list_pengaduan.MEDIA,
			list_pengaduan.KD_IJIN,
			list_pengaduan.NO_UPTSA,
			list_pengaduan.TANGGAL,
			list_pengaduan.STATUS,
			list_pengaduan.KATEGORI_P,
			master_ijin.ID_IJIN,
			master_ijin.NAMA_IJIN
			FROM list_pengaduan
			LEFT JOIN master_ijin master_ijin ON list_pengaduan.KD_IJIN = master_ijin.ID_IJIN
			WHERE list_pengaduan.KD_IJIN = 5
		");
		
		return $query->result_array();
	}
	
	function get_siup($get_taw,$get_tak)
	{
		$query = $this->db->query("
			SELECT 
			list_pengaduan.KD_LIST_PENGADUAN,
			list_pengaduan.NAMA,
			list_pengaduan.NO_TELEPON,
			list_pengaduan.EMAIL,
			list_pengaduan.ISI,
			list_pengaduan.MEDIA,
			list_pengaduan.KD_IJIN,
			list_pengaduan.NO_UPTSA,
			list_pengaduan.TANGGAL,
			list_pengaduan.STATUS,
			list_pengaduan.KATEGORI_P,
			master_ijin.ID_IJIN,
			master_ijin.NAMA_IJIN
			FROM list_pengaduan
			LEFT JOIN master_ijin master_ijin ON list_pengaduan.KD_IJIN = master_ijin.ID_IJIN
			WHERE list_pengaduan.KD_IJIN = 6
		");
		
		return $query->result_array();
	}
	
	function get_ipt($get_taw,$get_tak)
	{
		$query = $this->db->query("
			SELECT 
			list_pengaduan.KD_LIST_PENGADUAN,
			list_pengaduan.NAMA,
			list_pengaduan.NO_TELEPON,
			list_pengaduan.EMAIL,
			list_pengaduan.ISI,
			list_pengaduan.MEDIA,
			list_pengaduan.KD_IJIN,
			list_pengaduan.NO_UPTSA,
			list_pengaduan.TANGGAL,
			list_pengaduan.STATUS,
			list_pengaduan.KATEGORI_P,
			master_ijin.ID_IJIN,
			master_ijin.NAMA_IJIN
			FROM list_pengaduan
			LEFT JOIN master_ijin master_ijin ON list_pengaduan.KD_IJIN = master_ijin.ID_IJIN
			WHERE list_pengaduan.KD_IJIN = 7
		");
		
		return $query->result_array();
	}
	
	function get_lain($get_taw,$get_tak)
	{
		$query = $this->db->query("
			SELECT 
			list_pengaduan.KD_LIST_PENGADUAN,
			list_pengaduan.NAMA,
			list_pengaduan.NO_TELEPON,
			list_pengaduan.EMAIL,
			list_pengaduan.ISI,
			list_pengaduan.MEDIA,
			list_pengaduan.KD_IJIN,
			list_pengaduan.NO_UPTSA,
			list_pengaduan.TANGGAL,
			list_pengaduan.STATUS,
			list_pengaduan.KATEGORI_P,
			master_ijin.ID_IJIN,
			master_ijin.NAMA_IJIN
			FROM list_pengaduan
			LEFT JOIN master_ijin master_ijin ON list_pengaduan.KD_IJIN = master_ijin.ID_IJIN
			WHERE list_pengaduan.KD_IJIN = 8
		");
		
		return $query->result_array();
	}
}